<?php
return array(
    'method' => 'POST',
	'action' => '/users/login/restore-password',
    'elements' => array(
        'user_email' => array(
			'type' => 'text',
			'options' => array(
				'order' => 15,
				'label' => 'E-mail',
				'required' => true,
				'filters' => array(
					'StringTrim',
				),
				'validators' => array(
					array(
						'validator' => 'EmailAddress',
						'breakChainOnFailure' => true,
						'options' => array('max' => 64)
					),
					array(
						'validator' => 'Db_RecordExists',
						'breakChainOnFailure' => true,
						'options' => array(
							'table' => 't_user',
							'field' => 'email',
						),
					),
				),
			)
		),
		'user_password' => array(
			'type' => 'password',
			'options' => array(
				'order' => 20,
				'label' => 'Новый пароль',
				'required' => true,
				'filters' => array(
					'StringTrim',
				),
				'validators' => array(
					array(
						'validator' => 'StringLength',
						'breakChainOnFailure' => true,
						'options' => array('min' => 6)
					),
				),
			)
		),
        'confirm_password' => array(
			'type' => 'password',
			'options' => array(
				'order' => 30,
				'label' => 'Подтверждение пароля',
				'required' => true,
				'filters' => array(
					'StringTrim',
				),
				'validators' => array(
					array(
						'validator' => 'Identical',
						'breakChainOnFailure' => true,
						'options' => array('token' => $_POST['user_password'])
					),
				),
			)
		),
		'submit' => array(
            'type' => 'submit',
            'options' => array(
                'order' => 50,
                'ignore' => true,
                'label' => 'Отправить',
            )
        )
    )
);
?>